package com.lemon.smartsafety.entity.address;

import com.lemon.smartsafety.entity.common.IndexModel;
import com.lemon.smartsafety.utils.RulesUtils;
import com.lemon.smartsafety.utils.common.StringUtils;

import java.io.Serializable;

/**
 * Created by Cooliean on 16/4/12.
 */
public class AddrBookVo implements Serializable, IndexModel {
    private int    book_id        = 0;
    private String book_name      = "";
    private String pinyin         = "";
    private String keywords       = "";
    private int    is_public      = 0;
    private String create_time    = "";
    private String create_user_id = "";
    private String remark         = "";
    private String user_info      = "";


    public int getBook_id() {
        return book_id;
    }

    public void setBook_id(int book_id) {
        this.book_id = book_id;
    }

    public String getBook_name() {
        return book_name;
    }

    public void setBook_name(String book_name) {
        this.book_name = book_name;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public int getIs_public() {
        return is_public;
    }

    public void setIs_public(int is_public) {
        this.is_public = is_public;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getCreate_user_id() {
        return create_user_id;
    }

    public void setCreate_user_id(String create_user_id) {
        this.create_user_id = create_user_id;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getUser_info() {
        return user_info;
    }

    public void setUser_info(String user_info) {
        this.user_info = user_info;
    }

    @Override
    public String getIndexCharI() {
        String charIndex = "";

        if (StringUtils.nullValue(getPinyin()).length() != 0) {
            charIndex = getPinyin().substring(0, 1);
        }

        charIndex= RulesUtils.getFristChar(charIndex);

        return charIndex;
    }

    @Override
    public String getTitleI() {
        return this.book_name;
    }

    @Override
    public String getSubTitleI() {
        return this.user_info;
    }

    @Override
    public String getStatusTip() {
        return "";
    }

    @Override
    public int getStatusI() {
        return 0;
    }

    @Override
    public void setIndexChar(String indexChar) {
        this.pinyin = indexChar;
    }

}
